package com.skyline.user.dao;

import java.util.List;

import com.skyline.base.type.Activity;
import com.skyline.base.type.IdolType;
import com.skyline.common.bean.Page;
import com.skyline.user.model.Fan;

public interface FanDao {

	/**
	 * 查找粉丝
	 * 
	 * @param idolId
	 * @return
	 */
	public List<Fan> queryFansByIdolId(Long idolId, Page page, Activity activity);

	/**
	 * 查找关注
	 * 
	 * @param fanId
	 * @return
	 */
	public List<Fan> queryIdolsByFanId(Long fanId, Page page, Activity activity);

	/**
	 * 根据关注类型筛选关注
	 * 
	 * @param fanId
	 * @param idolType
	 * @return
	 */
	public List<Fan> queryIdolsByFansIdAndIdolType(Long fanId,
			IdolType idolType, Page page, Activity activity);

	/**
	 * 判断是否关注
	 * 
	 * @param idolId
	 * @param fanId
	 * @return
	 */
	public boolean existAttention(Long idolId, Long fanId, Activity activity);

	/**
	 * 计算粉丝数
	 * 
	 * @param idolId
	 * @return
	 */
	public int countFansByIdolId(Long idolId);// 计算对象fans数

	/**
	 * 根据关注类型计算已关注数
	 */
	public int countIdolByFansIdAndIdolType(Long fanId, IdolType idolType);

	/**
	 * 插入关注
	 * 
	 * @param idolId
	 * @param idolNickname
	 * @param idolPortrait
	 * @param fanId
	 * @param fanNickname
	 * @param fanPortrait
	 * @param idolType
	 */
	public void insertIdolAndFans(Long idolId, String idolNickname,
			String idolPortrait, Long fanId, String fanNickname,
			String fanPortrait, IdolType idolType, boolean attentionType);

	/**
	 * 删除关注
	 * 
	 * @param idolId
	 * @param fanId
	 */
	public void deleteIdol(Long idolId, Long fanId);

	/**
	 * 恢复关注
	 * 
	 * @param idolId
	 * @param fanId
	 */
	public void recoverAttention(Long idolId, Long fanId);

	/**
	 * 更新关注类型，在spot管理员变更时使用
	 * 
	 * @param idolId
	 * @param fanId
	 */
	public void updateAttentionType(Long idolId, Long fanId,
			boolean attentionType);

}
